<template>
  <div class="songitem">
    <!-- 排序 -->
    <div class="order">
      <span>{{order}}</span>
    </div>
    <!-- 歌曲图片 -->
    <div class="atater">
      <img :src="img + '?param=120y120'"
           lazy="loaded">
      <div class="play-icon">
        <i class="el-icon-video-pause"></i>
      </div>
    </div>
    <!-- 歌曲名 -->
    <div class="name">
      <span>{{name}}</span>
      <i class=""></i>
    </div>
    <!-- 作者 -->
    <div class="author">
      <span>{{author}}</span>
    </div>
    <!-- 专辑名 -->
    <div class="album">
      <span>{{album}}</span>
    </div>
    <!-- 时长 -->
    <div class="time">
      <span>{{time| durationFormat}}</span>
    </div>
  </div>
</template>
<script>
export default {
  // props: ['data', 'order'],
  props: {
    data: Object,
    id: Number,
    order: Number,
    img: String,
    name: String,
    author: String,
    album: String,
    time: Number
  },
  data () {
    return {

    }
  },
  created () {

  },
  methods: {

  }
}
</script>
 <style lang='less' scoped>
.songitem {
  display: flex;
  padding: 0.058565rem;
  font-size: 0.087848rem;
  align-items: center;
  cursor: pointer;
  &:hover .atater .play-icon {
    opacity: 1;
  }

  .order {
    flex: 5%;
    display: flex;
    padding: 0.073206rem;
    margin-right: 0.058565rem;
    justify-content: center;
    align-items: center;
    color: #bebebe;
  }
  .atater {
    position: relative;
    width: 0.439239rem;
    height: 0.439239rem;
    margin-right: 0.146413rem;
    img {
      width: 0.439239rem;
      height: 0.439239rem;
      border-radius: 0.036603rem;
    }
    .play-icon {
      position: absolute;
      width: 0.263543rem;
      height: 0.263543rem;
      text-align: center;
      line-height: 0.263543rem;
      font-size: 0.175695rem;
      border-radius: 50%;
      background-color: rgba(225, 225, 225, 0.562);
      top: 50%;
      left: 50%;
      -webkit-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);

      opacity: 0;
      transition: all 0.3s;
      -webkit-transition: all 0.3s;
      i {
        color: red;
      }
    }
  }
  .name {
    flex: 25%;
  }
  .author {
    flex: 25%;
  }
  .album {
    flex: 25%;
  }
  .time {
    flex: 10%;
  }
  &:hover {
    background-color: aliceblue;
  }
}
</style>
